var t = getApp(), e = require("../../0BACB9C3A71FB5DF6DCAD1C4BE4CA4D1.js"), a = require("../../C6EFF1F4A71FB5DFA08999F3BD3CA4D1.js").navBack;

Page({
    data: {
        show: !1,
        selectData: [ "+86" ],
        index: 0,
        phoneNumber: "",
        statusBarHeight: t.globalData.statusBarHeight,
        titleBarHeight: t.globalData.titleBarHeight,
        code: ""
    },
    onLoad: function(t) {
        this.getCode();
    },
    selectTap: function() {
        this.setData({
            show: !this.data.show
        });
    },
    getCode: function() {
        var t = this;
        e._cb;
        wx.showLoading({
            title: "",
            mask: !0
        }), wx.login({
            success: function(e) {
                wx.hideLoading(), e.code ? t.setData({
                    code: e.code
                }) : wx.showModal({
                    title: "提示",
                    content: e.errMsg,
                    confirmText: "重试",
                    success: function(e) {
                        e.confirm && t.getCode(), e.cancel && wx.navigateBack({
                            delta: 1
                        });
                    }
                });
            },
            fail: function(e) {
                wx.hideLoading(), wx.showModal({
                    title: "提示",
                    content: e.errMsg,
                    confirmText: "重试",
                    success: function(e) {
                        e.confirm && t.getCode(), e.cancel && wx.navigateBack({
                            delta: 1
                        });
                    }
                });
            }
        });
    },
    optionTap: function(t) {
        this.setData({
            index: t.currentTarget.dataset.index,
            show: !this.data.show
        });
    },
    bindGetUserInfo: function(t) {
        if ("getUserInfo:ok" === t.detail.errMsg) {
            wx.showLoading({
                mask: !0,
                title: "授权登录中..."
            });
            var a = t.detail;
            a.code = this.data.code, e.thirdPartyLogin(a);
        } else {
            var i = require("../../0BACB9C3A71FB5DF6DCAD1C4BE4CA4D1.js")._cb;
            "function" == typeof i && (i(1002), e._cb = null), wx.navigateBack({
                delta: 1,
                complete: function() {
                    wx.showModal({
                        showCancel: !1,
                        title: "提示",
                        content: "需要授权登录才能继续"
                    });
                }
            });
        }
    },
    goback: function() {
        a();
    }
});